#include <string>
#include "TagHeader.h"
#include "Tag.h"
using namespace swfstream;
TiXmlElement* TagHeader::toTiXmlElement() {
	TiXmlElement *r = new TiXmlElement("TagHeader");
	r->SetAttribute("length", length);
	std::string typeName = Tag::getTypeName(type);
	if (typeName == "") {
		r->SetAttribute("type", type);
	} else {
		r->SetAttribute("type", typeName);
	}
	return r;
}
